﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Anheledir.XmlDialogEditor {
  public partial class remoteBrowser : Form {
    private string[] fl;
    private bool s;

    public remoteBrowser() {
      InitializeComponent();
    }

    public remoteBrowser( string[] rfl, bool save ) {
      fl = rfl;
      s = save;

      InitializeComponent();
    }

    public string getFile() {
      return comboBox1.Text;
    }

    private void remoteOpen_Load( object sender, EventArgs e ) {
      if ( s ) {
        button1.Text = languages.MenuSave;
        this.Text = languages.RemoteServerSaveFile;
      } else {
        button1.Text = languages.Load;
        this.Text = languages.RemoteServerOpenFile;
      }
      button2.Text = languages.Cancel;
      
      groupBox1.Text = languages.Files;

      foreach ( string str in fl ) {
        comboBox1.Items.Add( str );
      }
    }

    private void comboBox1_TextChanged( object sender, EventArgs e ) {
      if ( comboBox1.Text != string.Empty ) {
        button1.Enabled = true;
      } else {
        button1.Enabled = false;
      }
    }
  }
}
